﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Entities;
using Utility;
using BUS;

public partial class A_LetsDeal_MasterPage : System.Web.UI.MasterPage
{

    protected void Page_Load(object sender, EventArgs e)
    {
        load_data();
    }

    private void load_data()
    {
        Tbl_LoaiSP_Collection lspCollection = Tbl_LoaiSP_BUS.GetAll();
        Repeater1.DataSource = lspCollection;
        Repeater1.DataBind();
    }

    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.AlternatingItem ||
                  e.Item.ItemType == ListItemType.Item)
        {
            Tbl_LoaiSP_Entities dn = (Tbl_LoaiSP_Entities)e.Item.DataItem;
            HyperLink hyp_item = (HyperLink)e.Item.FindControl("hyp_item");
            hyp_item.Text = dn.TenLoai;
            hyp_item.NavigateUrl = "~/A_LetsDeal/Default.aspx?loaisanpham=" + dn.STT.ToString();
        }
    }

    protected void lbt_dn_Click(object sender, EventArgs e)
    {
        string tendn = txt_tdn.Text;
        string mk = txt_matkhau.Text;
        Response.Redirect("~/A_LetsDeal/dangnhap.aspx?cmd=dangnhap&id=" + tendn + "&pass=" + mk);
    }

    protected void lbt_thoat_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/A_LetsDeal/dangnhap.aspx?cmd=signout");
    }

    protected void lbt_tendangnhap_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/A_LetsDeal/quanlycanhan.aspx");
    }
}
